package com.api.sw.duban.action;

import com.alibaba.fastjson.JSONObject;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.util.ConditionFactory;
import com.api.browser.util.ConditionType;
import com.api.sw.duban.model.Assigned;
import com.api.sw.duban.model.FkTimejl;
import com.api.sw.duban.service.AssignedBaseService;
import com.api.sw.duban.service.FkTimeBaseService;
import com.api.sw.duban.util.BaseUtil;
import com.api.sw.duban.util.DubUtil;
import com.api.sw.duban.util.LogTool;
import com.api.sw.duban.util.SqlUtil;
import com.cloudstore.eccom.constant.WeaBoolAttr;
import com.cloudstore.eccom.pc.table.*;
import com.cloudstore.eccom.result.WeaResultMsg;
import weaver.conn.RecordSet;
import weaver.general.PageIdConst;
import weaver.general.Util;
import weaver.hrm.User;

import java.text.SimpleDateFormat;
import java.util.*;

/*
    立项签收
 */
public class DubanGzAction {
    private final static LogTool log = new LogTool("/log/duban/",false);
    public DubanGzAction(){

    };
    /*
        补发时限
     */
    public String SetBfSx(String jbjlid,List<String> list ){
        String mess="";
        List<Object> listSql=new ArrayList<Object>();
        RecordSet re=new RecordSet();
        FkTimejl fkTimejl=null;
        jbjlid=Util.null2String(jbjlid).trim();
        if(!"".equals(jbjlid)&&list!=null&&list.size()>0){
            if(jbjlid.endsWith(",")){
                jbjlid=jbjlid.substring(0,jbjlid.length()-1);
            }
            String sql="select * from  uf_dbjblb where id in ("+jbjlid+")";
            re.execute(sql);
            while(re.next()){
                String id=Util.null2String(re.getString("id"));
                String ssrwid=Util.null2String(re.getString("ssrwid"));
                for(String sj:list){
                    if("".equals(Util.null2String(sj))){
                        continue;
                    }
                    fkTimejl=new FkTimejl();
                    fkTimejl.setRwid(ssrwid);
                    fkTimejl.setFklx(1);
                    fkTimejl.setJbjlid(id);
                    fkTimejl.setFkyqsj(sj);
                    fkTimejl.setModeuuid(BaseUtil.getUUid());
                    listSql.add(fkTimejl);
                }

            }
        }
        if(listSql.size()>0){
            FkTimeBaseService fkTimeBaseService=new FkTimeBaseService();
            mess=Util.null2String(fkTimeBaseService.getObjMapList(listSql,null)) ;
        }
        return mess;
    }
}
